// for_example.go
package main

import (
	"fmt"
)

func main() {
	// map example:
	m:=make(map[string]string)
	m["jack"]="lily"
	m["tom"]="jerry"
	m["hello"]="world"
	
	for k,v:=range m{
		fmt.Println("key="+k+" value="+v)
	}
	
	//array example
	a:=make([]int,3)
	a[0]=12
	a[1]=32
	a[2]=74
	
	for i,n:=range a{
		fmt.Printf("array item %d %d \n",i,n)
	}
	
	//string example
	str:="jack"
	fmt.Println("string = "+str)
	for _,t:=range str{//attention: _ empty var
		//fmt.Println(s+" "+t);
		fmt.Printf("value - %v \n",t)
	}
}
